<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html class="login-bg">
<head>
	<title>E8NET - Sign up</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- bootstrap -->
<link href="/Public/Admin/css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="/Public/Admin/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
<link href="/Public/Admin/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

<!-- global styles -->
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/layout.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/elements.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/icons.css" />

<!-- libraries -->
<link href="/Public/Admin/css/lib/bootstrap-wysihtml5.css" type="text/css" rel="stylesheet" />
<link href="/Public/Admin/css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />
<link href="/Public/Admin/css/lib/morris.css" type="text/css" rel="stylesheet" />
<link href="/Public/Admin/css/popup.css" type="text/css" rel="stylesheet" />



<!-- open sans font -->
<!--<link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />-->

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<link href="/Public/Libs/confirm/jquery.confirm.css" type="text/css" rel="stylesheet" />


    <link rel="stylesheet" href="/Public/Admin/css/compiled/signup.css" type="text/css" media="screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="header">
        <p style="font-size:1.5em; color:#fff;">E8网络工作室管理后台登陆</p>
    </div>
    <div class="row-fluid login-wrapper">
        <div class="box">
            <div class="content-wrap">
                <h6>登录</h6>
                <input class="span12" id="act" name="account" type="text" placeholder="账号" />
                <input class="span12" id="pwd" name="password" type="password" placeholder="密码" />

                <span id="msg" style="display: none; color:darkred">
                    <i class="icon-remove-sign"></i>
                    <small></small>
                </span>

                <div class="action">
                    <a class="btn-flat info" href="javascript:login();">立即登录</a>
                </div>                
            </div>
        </div>

        <div class="span4 already">
            <p>忘记密码?</p>
            <a href="<?php echo U('Findpwd/index');?>">点击找回</a>
        </div>
    </div>

    <!-- loading modal -->
<div id="loading-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content" style="text-align:center; " >
    	<img src="/Public/Admin/img/loading.gif" style="margin:25px 0" />
    </div>
  </div>
</div>

<!-- sure modal -->
<div id="sure-modal" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">警告</h4>
      </div>
      <div id="sure-modal-body" class="modal-body">
        <p>One fine body&hellip;</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn-flat gray" data-dismiss="modal">取消</button>
        <button id="btn-sure-del" type="button" class="btn-flat danger">确认删除</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
	
	function lshow() {
		$("#loading-modal").modal('show',{
			backdrop:false,
			keyboard:false,
		});
	}


	function lhide() {
		$("#loading-modal").modal('hide');
	}

	function sshow(url,msg) {
		$("#sure-modal-body").html(msg);
		$("#btn-sure-del").click(function(){
			$("#sure-modal").modal('hide');
			lshow();

			/**
			 * php 5.6 bug
			 * 
			 * Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
             * Warning: Cannot modify header information - headers already sent in Unknown on line 0
			 *
			 * 解决次bug 需要添加一个没有意义的参数
			 */
			$.post(url,{data:''},function(result){
                var obj = eval('(' + result + ')');
                if (obj.result == 'RESULT_OK') {
                    lhide();
                    location.reload();
                } else {
                	lhide();
                    alert(obj.msg);
                }
            });

		});

		$("#sure-modal").modal('show');
	}

</script>

	<!-- scripts -->
    <script src="/Public/Admin/js/jquery-latest.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <script src="/Public/Admin/js/theme.js"></script>
    <script src="/Public/Admin/js/tools.js"></script>

    <script>

        function login() {

            var account = $('#act').val();
            var password = $('#pwd').val();

            if (account == "" || password == "") {
                $('#msg > small').html('账号/密码不能为空');
                $('#msg').show();
                return;
            }

            lshow();
            $.post('/admin.php?c=Login&a=login',{account:account,password:password},function(result){
                var obj = eval('(' + result + ')');
                if (obj.result == "RESULT_OK") {
                    window.location.href = obj.data;
                } else {
                    lhide();
                    $('#msg > small').html(obj.msg);
                    $('#msg').show();
                }
            });
        }
    </script>

</body>
</html>